1. Higher derivatives.
Maple has more than one notation which is used to describe the derivative. We have been using the
operator on functions to express the derivative. Thus
is Maple's way of describing the derivative of the function
, evaluated at the value
x
. Therefore,
is a function. But we often don't want to go to all the trouble of giving a function a name, and just describe a function in terms of some
expression, like
. We all know that the derivative of the function given by this expression is the function given by the expression
, although we usually skip the part of thinking about it as a function, and just say that the derivative of
is
. Maple allows us to skip the formality of defining a function and take the derivative of an expression as well, using the diff command. To find the derivative of
, all you need to type in is
> diff(x^3-3*x^2+x-1,x);
Notice that you do have to tell Maple which variable to differentiate with respect to, because it cannot read your mind. Many times, our functions will have unknown constants, and unless you tell Maple what the variable is, it does not understand what you have in mind. You have encountered this same phenomenon with the plot command.
Next, let us discover how to enter a second derivative in Maple. This will depend on whether we are differentiating a function, or an expression. For example, let us define the function f below.
> f:=x->x^3-3*x^2+x-1;
To find the derivative at a value x , we could do one of two things.
> D(f)(x);diff(f(x),x);
Notice that
is an expression, not a function, so we can use the
diff
command on it. Let us find the second derivative.
> (D@@2)(f);
> (D@@2)(f)(x);
> diff(f(x),x$2);
Thus (D@@n)(f) gives the n'th derivative of f as a function, (D@@n)(f)(x) gives the expression for the n'th derivative of f at x, and diff(f(x),x$n) gives the expression for the n'th derivative of f at x as well. ( Note that n should be a positive integer.)
If
,
(a) Find f'(x) and f''(x) .
(b) Graph f , f' and f'' on the same set of axis and compare them to see that your answers in part (a) are reasonable. Give a good description comparing the graphs of the three functions.
Submission worksheet: